<me:UIABAUFM  x:Class="WPFExcelReport.THFBAB50"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
     xmlns:me="clr-namespace:WPFExcelReport"   
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIABAUFM.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIABAUFM.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <WrapPanel >
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=批次:}}" FontSize="18"/>
                    <TextBox  Grid.Column="2" MaxLength="10" Height="30" KeyUp="Query_KeyUp" FontSize="18" Background="White" 
                              CharacterCasing="Upper" Text="{Binding FINISH,ElementName=TV}" Width="130" />
                </Grid>

                <Button  Click="QueryCommand"  Content="{Binding Source={Localization:Translate Word=查询}}"
                         FontSize="18" Height="40" Margin="5,0,0,0" Width="120" />
                <Button  Grid.Column="1"  Click="PrintCommand" Height="Auto" FontSize="18" Margin="5,0,0,0" Width="Auto" 
                         Content="{Binding Source={Localization:Translate Word=导出}}" />
            </WrapPanel> 
        </StackPanel>
        <DataGrid  Grid.Row="1"  
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                    x:Name="dlgMaster"  
                     SelectionMode="Single"
                >
            <!--
                   RowDetailsVisibilityMode="Visible"  -->
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=GPPARTIE, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=批次}}" Foreground="RED" IsReadOnly="True" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPART, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=纱线}}" Foreground="Red"  IsReadOnly="True" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPFARBE, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=色号}}" Foreground="Red"  IsReadOnly="True" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=QOKNEUD}" Header="{Binding Source={Localization:Translate Word=检验日期}}" Foreground="Red"  IsReadOnly="True" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=生产单}}" Foreground="Red"  IsReadOnly="True" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=TYP, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=纱型}}" Foreground="RED" IsReadOnly="True" Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</me:UIABAUFM>
